package com.niiwoo.civet.trade.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 信用借还款方式
 * @author liaojunjun
 *
 */
@AllArgsConstructor
@Getter
public enum CreditRepaymentTypeEnum {
    REPAY_PRINCIPAL_INTEREST_AT_TERM((byte)1, "到期还本息"),
    REPAY_PRINCIPAL_AT_TERM((byte)2, "每月付息到期还本"),
    AVERAGE_CAPITAL_PLUS_INTEREST((byte)5, "每月等额本息");

    private Byte value;
    private String desc;

    public static CreditRepaymentTypeEnum enumOf(int value) {
        for (CreditRepaymentTypeEnum retEnum : values()) {
            if (retEnum.value == value) {
                return retEnum;
            }
        }
        return null;
    }
}
